import { createApp } from 'vue'
import { createPinia } from 'pinia'
import "@nutui/nutui-taro/dist/style.css";
import { Button, Cell, Address, Cascader, Input, Switch, InputNumber, Picker, Popup, CellGroup } from "@nutui/nutui-taro";
import { IconFont } from "@nutui/icons-vue-taro";
import './assets/font/iconfont.css'
import { Tabs, TabPane } from '@nutui/nutui-taro'
import { Swipe } from '@nutui/nutui-taro'
import { Swiper, SwiperItem } from '@nutui/nutui-taro'
import { Rate } from '@nutui/nutui-taro'

// import { Toast } from "@nutui/nutui-taro";

import './app.scss'
import Taro from '@tarojs/taro';

const App = createApp({
    onLaunch() {
        console.log("onLaunch");
        // 显示当前页面的转发按钮
        // Taro.showShareMenu({
        //     withShareTicket: true,
        //     menus: ['shareAppMessage', 'shareTimeline']
        // });

        // // 分享给好友
        // Taro.useShareAppMessage(() => {
        //     return {
        //         title: '功德水 · 随喜供养',
        //         path: '/pages/index/index',
        //         imageUrl: 'https://via.placeholder.com/300x200/f4a261/fff?text=功德水'
        //     }
        // });

        // // 分享到朋友圈
        // Taro.useShareTimeline(() => {
        //     return {
        //         title: '功德水 · 随喜供养',
        //         imageUrl: 'https://via.placeholder.com/300x200/f4a261/fff?text=功德水'
        //     }
        // });
    }
})

App.use(createPinia());
App.use(Button);
App.use(Cell);
App.use(Address);
// App.use(IconFont); // IconFont 不需要全局注册
App.use(Cascader);
App.use(Input);
App.use(Tabs);
App.use(TabPane);
App.use(Swipe);
App.use(Swiper);
App.use(SwiperItem);
App.use(Rate);
App.use(Switch);
App.use(InputNumber);
App.use(Picker);
App.use(Popup);
App.use(CellGroup);

// Taro.hideLoading()
// App.use(Toast);

export default App
